#include<iostream>
#include<string>
#include<set>

using namespace std;

set<string> s;
string word;
int main(void) {
	int n, op;
	cin >> n;
	for(int i = 0; i < n; i++) {
		cin >> op >> word;
		for(int j = 0; j < word.size(); j++) {
			if(word[j] <= 'Z') word[j] = 'a' + word[j] - 'A';		 
		}
		if(op == 0) {
			s.insert(word);
		} else {
			if(s.count(word)) {
				cout << "Yes" << endl;
			} else {
				cout << "No" << endl;
			}
		}
	}
	return 0;
}
